﻿using System;

/*
 * The classes contained in this file are examples of statically typed metadata attributes that you would associate with enum instances
 * to store certain sets of data for each instance.
 * 
 * These enums are then used in the test project, EnumMetadata.Test, which shows how to consume metadata from enums that have been properly attributed.
*/
namespace com.ddmresources.EnumMetadata.Samples
{

    /// <summary>
    /// Decorates Enumerations to allow associated code table type information (e.g., Id, Code, Description) with each enum value. 
    /// </summary>
    [Serializable]
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
    public class CodeTableInfoAttribute : Attribute, ICodeTableInfo
    {
        #region Constructors

        public CodeTableInfoAttribute()
        {

        }

        public CodeTableInfoAttribute(string shortName, string longName)
        {
            ShortName = shortName;
            LongName = longName;
        }

        public CodeTableInfoAttribute(string shortName, string longName, string description)
        {
            ShortName = shortName;
            LongName = longName;
            Description = description;
        }

        #endregion

        #region Properties

        public int MappedId { get; set; }            //a database id column, or the like
        public string MappedCode { get; set; }      //a database lookup table code field, or the like
        public string ShortName { get; set; }       //short name suitable for use in UI
        public string LongName { get; set; }        //long name suitable for use in UI when more space is available
        public string Description { get; set; }     //full description of the enum value represents
        public string Tag { get; set; }             //Miscellaneous info, such as paths to image files

        #endregion

    }

    /// <summary>
    /// Decorates Enumerations to allow associated information that helps construct a url to send
    /// to a help service.
    /// </summary>
    [Serializable]
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
    public class HelpTopicInfoAttribute: Attribute, IHelpTopicInfo
    {
        #region Constructors
        public HelpTopicInfoAttribute()
        {
        }

        public HelpTopicInfoAttribute(string id, bool isContentCrossCompany, string skinName)
        {
            Id = id;
            IsContentCrossCompany = isContentCrossCompany;
            SkinName = skinName;
        } 
        #endregion

        #region Properties
        public string Id { get; set; }
        public bool IsContentCrossCompany { get; set; }
        public string SkinName { get; set; } 
        #endregion
    }
}
